package org.lds.hotkey.worker.component;

import org.lds.hotkey.worker.service.ReceiveRuleModelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class HotKeyModelConsumerRunner implements ApplicationRunner {

    @Autowired
    private ReceiveRuleModelService receiveRuleModelService;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        new Thread(() -> {
            while (true) {
                receiveRuleModelService.consume();
            }
        }).start();
    }
}
